<?php

namespace App\Models\Check;

use App\Models\BaseModel;
use Illuminate\Database\Eloquent\Factories\HasFactory;

class CruiseCheckScanCodeLogModel extends BaseModel
{
    protected $table      = 'cruise_check_scan_code_logs';
    public    $timestamps = false;
    protected $fillable   = [
        'shopId',
        'createdAt',
        'createdByUid',
        'checkManagerId',
    ];


    const STATUS_OK   = 1;  //正常
    const STATUS_OVER = 2;  //二维码已过期

    /**
     * 新增数据
     * @param int $shopId 门店ID
     * @param int $createdByUid 扫描人ID
     * @param int $checkManagerId 被扫人ID
     * @param int $status 二维码状态
     * @return bool
     */
    public static function insertData(int $shopId, int $createdByUid, int $checkManagerId, int $status): bool
    {
        return self::query()->insert([
            'shopId'         => $shopId,
            'createdByUid'   => $createdByUid,
            'checkManagerId' => $checkManagerId,
            'status'         => $status,
            'createdAt'      => time(),
        ]);
    }


}
